projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6712106
)
togglebutton: Fix expected group behavior
author
Matthias Clasen
<mclasen@redhat.com>
Sun, 11 Apr 2021 22:29:53 +0000
(18:29 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sun, 11 Apr 2021 22:29:53 +0000
(18:29 -0400)
The expectation is that a grouped button stays
active when you click it. Grouped check buttons
behave this way, and grouped toggle buttons should
too.
gtk/gtktogglebutton.c
patch
|
blob
|
history
diff --git
a/gtk/gtktogglebutton.c
b/gtk/gtktogglebutton.c
index 1e53a896c671fccf95047248c97f6b195bdad4ab..93ba0e7c07ec2d70774a1b6ed7d9049658b1e6d0 100644
(file)
--- a/
gtk/gtktogglebutton.c
+++ b/
gtk/gtktogglebutton.c
@@
-199,6
+199,9
@@
gtk_toggle_button_clicked (GtkButton *button)
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
+ if (priv->active && (priv->group_prev || priv->group_next))
+ return;
+
gtk_toggle_button_set_active (toggle_button, !priv->active);
}